package panel.baiduMap
{
	import assists.Lang;
	import assists.URI;
	import assists.log.Log;
	import assists.resource.ResourceLoader;
	
	import baidu.map.basetype.LngLat;
	import baidu.map.basetype.Size;
	import baidu.map.control.base.Navigator;
	import baidu.map.control.base.Overview;
	import baidu.map.control.base.Ruler;
	import baidu.map.control.base.Scaler;
	import baidu.map.core.Map;
	import baidu.map.layer.Layer;
	import baidu.map.layer.RasterLayer;
	
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.TransformGestureEvent;
	import flash.ui.Multitouch;
	import flash.ui.MultitouchInputMode;
	
	import inerface.ITestMapPanel;
	
	import main.ClientConstants;
	
	import panel.mapPanel.BaiduMap;
	
	public class TestMapPanel extends Sprite implements ITestMapPanel
	{
		private var _stage:Stage;
		private var _loader:ResourceLoader;
		private var _lang:Lang;
		private var _uri:URI;

		private var map:BaiduMap;
		
		public function TestMapPanel()
		{
		}
		
		public function init(stage:Stage, loader:ResourceLoader, lang:Lang, uri:URI=null):void
		{
			_stage = stage;
			_loader = loader;
			_lang = lang;
			_uri = uri;
			
			initThis();
		}
		
		private function initThis():void
		{
			map = new BaiduMap(_stage,_loader,_lang,_uri);
			map.init(_stage.stageWidth,_stage.stageHeight * .82);
			map.y = _stage.stageHeight * .08;
			this.addChild(map);
		}
		
		
		public function clear():void
		{
			if(_stage){
				_stage = null;
				_loader = null;
				_lang = null;
				_uri = null;
				
				map.clear();
			}
		}
	}
}